#include<stdio.h>

/**
 * A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91  99.
 *
 * Find the largest palindrome made from the product of two 3-digit numbers.
 *
 * /

/* 2010-03-17  */
char result[10];
int resulti;
int max;
int main(void)
{
	int i, j;
	for(i=1; i<=999; i++) {
		for(j=1; j<=999; j++) {
			sprintf(result, "%d", resulti = i * j);
			if ( result[0] == result[5]
      			  && result[1] == result[4]
      			  && result[2] == result[3] ) {
        			printf("%s\n", result);
			}
		}
	}
	return 0;
}
